<?php

/**
 * This is the model class for Graph
 *
 * The followings are the available columns in table 'conso_edf_releves':
 * @property string $dte
 * @property string $hp
 * @property string $hc
 * @property string $diffhp
 * @property string $diffhc
 * @property string $difftps
 */
class Graph extends CModel
{
	
    public $container;
    public $type = 'column';
    public $titre = '';
    public $yAxisTitle;
    
    /**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return ConsoEdfReleve the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}


	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('dte, hp, hc, diffhp, diffhc, difftps', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('dte, hp, hc, diffhp, diffhc, difftps', 'safe', 'on'=>'search'),
		);
	}


	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'dte' => 'Date et heure du relevé',
			'hp' => 'Relevé heures pleines',
			'hc' => 'Releve heures creuses',
			'diffhp' => 'Diff relevés prec hp',
			'diffhc' => 'Diff relevés prec hc',
			'difftps' => 'Durée relevé prec',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('dte',$this->dte,true);
		$criteria->compare('hp',$this->hp,true);
		$criteria->compare('hc',$this->hc,true);
		$criteria->compare('diffhp',$this->diffhp,true);
		$criteria->compare('diffhc',$this->diffhc,true);
		$criteria->compare('difftps',$this->difftps,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}